package com.link2room.optimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by sss on 2016/9/1.
 */
@Entity
@Table(name = "marketing_campaigns_channel", catalog = "")
@DynamicInsert
public class MarketingCampaignsChannel extends BaseEntity {
    public enum MarketingCampaignsChannel_{
        mcCode,pbChannel,rpCode,rpName,pbChannelName
    }
    /**
     * 活动代码
     */
    private String mcCode;
    /**
     * 发布渠道
     */
    private String pbChannel;
    /**
     * 发布渠道
     */
    private String pbChannelName;
    /**
     * 价格计划代码
     */
    private String rpCode;
    /**
     * 价格计划名字
     */
    private String rpName;

    @Basic
    @Column(name = "mc_code", nullable = false, length = 64)
    public String getMcCode() {
        return mcCode;
    }

    public void setMcCode(String mcCode) {
        this.mcCode = mcCode;
    }

    @Basic
    @Column(name = "pb_channel", nullable = false, length = 16)
    public String getPbChannel() {
        return pbChannel;
    }

    public void setPbChannel(String pbChannel) {
        this.pbChannel = pbChannel;
    }

    @Basic
    @Column(name = "pb_channel_name", nullable = false, length = 16)
    public String getPbChannelName() {
        return pbChannelName;
    }

    public void setPbChannelName(String pbChannelName) {
        this.pbChannelName = pbChannelName;
    }

    @Basic
    @Column(name = "rp_code", nullable = false, length = 32)
    public String getRpCode() {
        return rpCode;
    }

    public void setRpCode(String rpCode) {
        this.rpCode = rpCode;
    }

    @Basic
    @Column(name = "rp_name", nullable = false, length = 32)
    public String getRpName() {
        return rpName;
    }

    public void setRpName(String rpName) {
        this.rpName = rpName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MarketingCampaignsChannel that = (MarketingCampaignsChannel) o;

        if (mcCode != null ? !mcCode.equals(that.mcCode) : that.mcCode != null) return false;
        if (pbChannel != null ? !pbChannel.equals(that.pbChannel) : that.pbChannel != null) return false;
        if (rpCode != null ? !rpCode.equals(that.rpCode) : that.rpCode != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = mcCode != null ? mcCode.hashCode() : 0;
        result = 31 * result + (pbChannel != null ? pbChannel.hashCode() : 0);
        result = 31 * result + (rpCode != null ? rpCode.hashCode() : 0);
        return result;
    }


}
